package cn.aliang.cloud.feignorder.contorller;

import cn.aliang.cloud.feignorder.service.PaymentFeignService;
import cn.aliang.cloud.service.entity.ResultMessage;
import com.netflix.discovery.converters.Auto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @Author: chendongliang
 * @Date: 2020/7/21 9:54
 */

@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    PaymentFeignService paymentFeignService;

    @GetMapping("/pay/{id}")
    public ResultMessage<Void> pay(@PathVariable("id") String id ){
        return paymentFeignService.pay(id);
    }


    @GetMapping("/payForException/{id}")
    public ResultMessage<Void> payForException(@PathVariable("id") String id ){
        return paymentFeignService.payForException(id);
    }

}
